Electronic image registration for a scanner

ABSTRACT

A system electronically registers an image on an input document. The system includes a scanner for generating an image data stream representing an electronic image of the image on the input document and an edge detecting circuit for detecting edge data within the image data stream A circuit detects a first corner of a leading edge of the input document based on the detected edge data and for establishing a first coordinate value therefrom and a second corner of a leading edge of the input document based on the detected edge data and for establishing a second coordinate value therefrom. The system further determines a minimum and maximum location for a leading edge of the scanned document and determines a minimum and maximum location for a trailing edge of the scanned document. An image window is generated representing valid image data to processed and rendered based on the minimum and maximum location for a leading edge of the scanned document, the minimum and maximum location for a trailing edge of the scanned document, the first coordinate value, and the second coordinate value.

FIELD OF THE PRESENT INVENTION

[0001] The present invention is directed to an electronic imageregistration system for an image input terminal. More specifically, thepresent invention is directed to the electronic image registrationsystem for a scanner which reduces skew without utilizing additionalmechanical hardware.

BACKGROUND OF THE PRESENT INVENTION

[0002] In convention scanners which utilize a document handler to conveyoriginal documents to the scanning or input area, some type of mechanismis employed to register the document at a required exposure position.These mechanisms position the document more accurately and reduce theskew. In the conventional scanners, mechanical hardware is utilized toregister the document for proper scanning.

[0003] An example of a conventional registration device is disclosed inthe Xerox Disclosure Journal, Vol. 12, No. 1, entitled, “IMPROVEDPERFORMANCE OF A DOCUMENT REGISTRATION FIGURE/PLATEN INTERFACE,” theentire contents of which are hereby incorporated by reference. In thisconventional registration system, a copier scans the image through aglass platen. The registration system also includes a plastic ramp whichadjusts the height of the glass platen by means of an adjusting screw.The plastic ramp also serves as a guide for registration fingers to movefrom an out of registration position to a registration position. In theregistration position, the registration fingers butt up against the edgeof the platen and protrude above the top surface such that a documentconveyed on top of the surface of the platen is stopped at the fingersin the required registration position.

[0004] Another example of a conventional registration and deskew deviceis disclosed in Xerox Disclosure Journal, Vol. 10, No. 2, entitled,“LEADING EDGE DESKEW AND REGISTRATION DEVICE,” the entire contents ofwhich are hereby incorporated by reference. The Xerox Disclosure Journalarticle discloses a device which provides both deskewing andregistration. In the registration system, two paper guide plates areutilized. An original document moves along a first guide plate towards asecond guide plate by a means of a conveyor system or pinch rollers. Thedocument stops at a wait station as the leading edge of the documententers an area between the first guide plate and the second guide plate.As the document enters this area, the leading edge registration deviceis in the raised position such that two guides on the registrationdevice project up into the area between the first paper guide plate andthe second guide plate. The leading edge registration device then movesa fixed amount opposite the direction of the travel of the document soas to deskew the document and place the document into a properregistration position. After the deskewing motion, the leading edgeregistration device lowers out of the paper path and the document cancontinue from the first paper guide plate to the second paper guideplate.

[0005] A drawback associated with conventional registration systems isthat conventional registration systems require additional mechanicalhardware in the paper path so as to physically register the document inthe proper scanning position. This utilization of mechanical devices tophysically register the document for proper scanning is a relativelyslow solution which cannot be readily utilized in a high speed scanner.Moreover, such mechanical systems cannot be utilized in a centeredregistered constant velocity transport scanner since the exact fast scanlocation of the input can vary from document to document. Therefore, fora registration system to be utilized in a high speed scanner or inconjunction with a centered registered constant velocity transportsystem scanner, the registration system must be able to register theinput of the document quickly, dynamically, variably, and accurately.

[0006] Automatic document detection is intended to locate “anyrectangular piece” of document placed “anywhere” on the platen. Such aprocess requires an initial prescan to locate edges (black->whitetransition followed by white->black transition). With the detection ofthe corners of the document with respect to the platen edges, a secondscan is performed to image the appropriate region (either the outerbounding box containing the entire document, or the largest possiblerectangular box that could be enclosed within the four corners to avoidany black borders). The document size obtained during prescan enablesthe machine to either setup reduction/enlargement parameters to fit ontoa preselected output paper or to select the appropriate output paper tofit 100% of the input image.

[0007] Although this process is available, it desirable to have aprocess which does not rely on the assumption of the input document'ssize. The present invention is directed to a method for detecting allthe four corners of a document placed on a platen. Unlike the processmentioned in U.S. Pat. No. 5,528,387, the present invention makes noassumption with respect the input size of the document to determine thethird and fourth corners (C₂, C₃) of the input document.

SUMMARY OF THE PRESENT INVENTION

[0008] One aspect of the present invention is a system forelectronically registering an image on an input document. The systemincludes scanning means for generating an image data stream representingan electronic image of the image on the input document; edge detectingmeans, operatively connected to said scanning means, for detecting edgedata within the image data stream; first corner detecting means,operatively connected to said edge detecting means, for detecting afirst corner of a leading edge of the input document based on thedetected edge data and for establishing a first coordinate valuetherefrom; second corner detecting means, operatively connected to saidedge detecting means, for detecting a second corner of a leading edge ofthe input document based on the detected edge data and for establishinga second coordinate value therefrom; edge range determining means fordetermining a minimum and maximum location for a leading edge of thescanned document and for determining a minimum and maximum location fora trailing edge of the scanned document; and window means for generatingan image window representing valid image data to processed and renderedbased on said minimum and maximum location for a leading edge of thescanned document, said minimum and maximum location for a trailing edgeof the scanned document, said first coordinate value, and said secondcoordinate value.

[0009] Another aspect of the present invention is a method forelectronically registering an image on an input document. The methodgenerates an image data stream representing an electronic image of theimage on the input document; detects edge data within the image datastream; detects a first corner of a leading edge of the input documentbased on the detected edge data and for establishing a first coordinatevalue therefrom; detects a second corner of a leading edge of the inputdocument based on the detected edge data and for establishing a secondcoordinate value therefrom; determines a minimum and maximum locationfor a leading edge of the scanned document; determines a minimum andmaximum location for a trailing edge of the scanned document; andgenerates an image window representing valid image data to processed andrendered based on the minimum and maximum location for a leading edge ofthe scanned document, the minimum and maximum location for a trailingedge of the scanned document, the first coordinate value, and the secondcoordinate value.

[0010] Further objects and advantages of the present invention willbecome apparent from the following descriptions of the variousembodiments and characteristic features of the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The following is a brief description of each drawing used todescribe the present invention, and thus are being presented forillustrative purposes only and should not be limitative of the scope ofthe present invention, wherein:

[0012]FIG. 1 shows a graphical representation illustrating an overlaidrelationship between an input document and an output document;

[0013]FIG. 2 shows another graphical representation illustrating anoverlaid relationship between an input document and an output document;

[0014]FIG. 3 shows a flowchart illustrating the setting of C₀ for aninput document;

[0015]FIG. 4 shows a flowchart illustrating the generation of white fillareas for registering the input image area;

[0016]FIG. 5 shows a block diagram illustrating a circuit whichelectronically registers an image area from an input document;

[0017]FIG. 6 shows a block diagram illustrating a preferred circuitwhich electronically registers an image area from an input document;

[0018]FIG. 7 is a block diagram showing the architecture for determiningthe corners of a scanned document;

[0019]FIG. 8 is a flowchart illustrating the edge detection and cornerdetection process; and

[0020]FIG. 9 is an illustration of the deskewing measurements.

DETAILED DESCRIPTION OF THE PRESENT INVENTION

[0021] The following will be a detailed description of the drawingsillustrated in the present invention. In this description, as well as inthe drawings, like references represent like devices, circuits, orcircuits performing equivalent functions.

[0022] As noted above, FIG. 3 shows a flowchart illustrating the settingof the coordinate value VC₀. VC₀ is coordinate value representing onecorner of the input document 1 as illustrated in FIGS. 1 and 2.

[0023] More specifically, the VC_(o) can be defined as (S_(CO), P_(CO))wherein S_(CO) is a scanline location value and P_(CO) is a pixellocation value. To determine the coordinate value VC₀, image (video)data received from the scanner, a full width array or CCD sensor cells,is analyzed to detect edge data. Edge data is the data representing thetransition between image data representing a background of the platencover or the background of a constant velocity transport (CVT) deviceand a leading edge of an input document. This edge data is received instep S1. The edge data is analyzed, as illustrated in FIG. 3, at step S3to detect the physical corner C₀ of the input document 1 as illustratedin FIGS. 1 and 2. If the physical corner of the input document C₀ is notdetected within a predetermined number of scanlines, coordinate valueVC₀ is set to a default value.

[0024] However, if the physical corner of the input document is detectedat step S3, the coordinate value VC₀ (S_(CO), P_(CO)) is set to be equalto the measure coordinate value of the physical corner C₀ of the inputdocument 1 of FIGS. 1 and 2 at step S5. At step S7, it is determinedwhether the set coordinate value VC₀ is within a predetermined number oflines from the start of the scanning process; i.e., is S_(CO) less thanor equal to a predetermined scanline value. If the set coordinate valueVC₀ is not within a predetermined number of lines, the coordinate valueVC₀ value is set to a first default value at step S9.

[0025] On the other hand, if the set coordinate value VC₀ is within apredetermined number of lines, step S11 determines whether the setcoordinate value VC₀ is within a predetermined number of pixels of anominal center value; i.e., is P_(CO) within a predetermined number ofpixels of the nominal center value.

[0026] This nominal center value is related to the center of thescanning area, and in the preferred embodiment, the nominal center valueis equal to 2480. More specifically, the nominal center valuecorresponds to the pixel of the full width array which is centered inthe fast scan direction for a particular paper width; i.e., if the fullwidth array is 11 inches wide, the nominal center value will correspondto the pixel located at 5.5 inches.

[0027] If the set coordinate value VC₀ is within a predetermined numberof pixels of the nominal center pixel, step S13 sets the coordinate VC₀value to a second default value.

[0028] On the other hand, if the set coordinate VC₀ value is not withina predetermined number of pixels of the nominal center pixel, step S15determines whether the set coordinate value VC₀ was detected before thenominal center pixel. If the set coordinate value VC₀ was not detectedbefore the nominal center pixel, step S17 sets the coordinate value VC₀to a third default value. Moreover, if the coordinate value VC₀ wasdetected before the nominal center pixel, the set coordinate value VC₀remains the same.

[0029] As demonstrated in FIG. 3, the coordinate value of the corner VC₀of the input document is determined by analyzing the image data beingreceived by a scanner.

[0030] Once the coordinate value VC₀ is set, the registration processmoves on to the flowchart illustrated in FIG. 4. In FIG. 4, after thecoordinate value C₀ is set, step S19 continues to receive video data sothat the center of the input document can be detected. The receivedvideo data is analyzed at step S21 to determine if the center of theinput document has been detected. To detect this center point, thenominal center pixel of the full width array is monitored for thepresence of edge data. When edge data is present, the center of theinput document has been detected. If the center of the document has notbeen detected, step S45 determines whether a predetermined number ofscanlines have been processed. If a predetermined number of scanlineshave not been processed, the process returns to step S19. It is notedthat during this process to detect the center of the input document, acounter keeps track of the number of scanlines that have been processed.

[0031] If a predetermined number of scanlines have been processed, acenter value is set at step S23. It is further noted that if edge datais detected at the nominal center pixel at step S21, the center value isset at step S23 to the value corresponding to the position of thedetected leading edge data. The center value is a coordinate valuewherein the fast scan coordinate is already known by the position of thenominal center pixel of the full width array and the slow scancoordinate is set equal to the number of scanlines which have beenprocessed at this point in time.

[0032] After the center coordinate value has been set at step S23, stepS25 creates a first white fill area which is initially one scanline highand equal in width to the page width (fast scan direction length) of theinput document. The page width of the input document is determined fromsensors which are set prior to feeding the input document into thescanning area or can be inputted by the user through an user interface.

[0033] Upon initiating the creation of the first white fill area, stepS27 determines whether the physical corner C₁ of the input document hasbeen detected. If the physical corner C₁ (S_(C1), P_(C1)) of the inputdocument has not been detected, step S29 adds a scanline to the firstwhite fill area. Upon adding to the first white fill area, step S31determines whether a predetermined number of scanlines have beenprocessed since the setting of the center value. If a predeterminednumber of scanlines has not been processed, the process returns to stepS27, wherein further image data is analyzed to detect the presence ofthe physical corner C₁ of the input document. On the other hand, if apredetermined number of scanlines has been processed, step S31 sets acoordinate value VC₁ to a fourth default setting at step S39.

[0034] If step S27 detects the presence of the physical corner C₁ of theinput document, step S33 determines whether the detection of this corneris closer than a predetermined number of pixels from the nominal centerpixel of the full width array. If the detected physical corner C₁ of theinput document is closer than the predetermined number of pixels fromthe nominal center pixel of the full width array, it is assumed that thedocument is either dog-eared or black edged and step S35 sets thecoordinate value VC₁ to a fifth default setting. However, if thedetected physical corner of the input document is not closer than apredetermined number of pixels from the nominal center, step S37 setsthe coordinate value VC₁ to the detected value.

[0035] Next, the process determines at step S41 the skew angle of theinput document and the undetected corners C₂ and C₃ from the coordinatevalues VC₀ and VC₁ using conventional methods. Upon determining the skewangle and the calculated coordinate values of VC₂ and VC₃, step S43generates second and third white fill areas so as to define the actualimage area to be processed as the output image.

[0036]FIG. 5 illustrates a block diagram of a circuit which registersthe input image from an input document to be stored as a bitmap in amemory. Initially, the input document is scanned by a full width array(FWA) 11 which in the preferred embodiment of the present invention is aline scanner utilized in connection with a constant velocity transport(CVT) system. The FWA 11 produces image data which is fed into an edgedetection circuit 13 which looks for edge data in the image data inputstream. The image data is also fed into a multiplexer 33. The FWA 11also produces a scanline signal which indicates the beginning of eachnew scanline and a pixel clock signal which indicates the appearance ofthe new set of image data corresponding to a single pixel.

[0037] The edge detecting circuit 13 produces a signal indicating thepresence of edge data in the image data input stream. This signalindicating the detection of edge data is fed into a C₀ detecting circuit21, a center detecting circuit 23, and a C₁ detecting circuit 13. The C₀detecting circuit 21 detects the initial presence of the first corner ofthe input document labeled as C₀. The C₀ detecting circuit 21 representsa detection implementation which can be done in hardware or in softwareby a microprocessor. When the first corner C₀ has been detected by thedetected circuit 21, the C₀ detecting circuit 21 outputs a signalindicating the detection of the first corner to a C₀ setting circuit 25and the C₁ detecting circuit 15. The VC₀ setting circuit 25 sets thecoordinate value of the first corner of the input document VC₀ accordingto the various parameters illustrated in FIG. 3. The VC₀ setting circuit25 represents a setting implementation which can be done in hardware orin software by a microprocessor.

[0038] Thus, to properly set the coordinate value VC₀, the VC₀ settingcircuit 25 receives a signal from counter 19 which maintains the presentnumber of scanlines which have been processed, a signal from the C_(o)detecting circuit 21, the pixel clock signal, and a center detectingsignal from center detecting circuit 23. From these four input signals,the C₀ setting circuit 25 produces the coordinate value VC₀ and outputsthis value to a white field area generator 29 and image area circuit 31.

[0039] The center detecting circuit 23 is a circuit which detects thepresence of edge data associated with the nominal center of the FWA. Thecenter detecting circuit 23 represents a detection implementation whichcan be done in hardware or in software by a microprocessor. Morespecifically, the center detecting circuit 23 detects when the nominalcenter produces edge data. When the nominal center cell of the FWA 11produces edge data, the center detecting circuit 23 outputs a centerdetection signal to the VC₀ setting circuit 25, a center setting circuit27, the white field area generator 29, and the C₁ detecting circuit 15.The center setting circuit 27 sets a coordinate value of the center ofthe leading edge of the input document based on the center detectingsignal from the center detecting circuit 23 and the value in the counter19. The counter 19 represents a tracking implementation can be done inhardware or in software by a microprocessor. The center setting circuit27 sets the coordinate center value and outputs this value to the whitefield area generator 29, image area circuit 31, and a VC₁ settingcircuit 17. The center setting circuit 27 represents a settingimplementation which can be done in hardware or in software by amicroprocessor.

[0040] The C₁ detecting circuit 15 only detects for edge data after thefirst corner of the input document and the center of the input documenthave been detected. The C₁ detecting circuit 15 detects the secondphysical corner of the input document and produces a detection signalwhich is fed to the VC₁ setting circuit 17. The C₁ detecting circuit 15represents a detection implementation which can be done in hardware orin software by a microprocessor. The VC₁ setting circuit 17 sets thecoordinate value of the second corner of the input document and outputsthis value to the white field area generator 29. The VC₁ setting circuit17 represents a setting implementation which can be done in hardware orin software by a microprocessor.

[0041] The white field area generator 29 produces blocks of data whichare associated with a non-image area of the output image. Thisgeneration of blocks of data by the white field area generator 29 can bedone in hardware or in software by a microprocessor or a combination ofboth. More specifically, in the preferred embodiment of the presentinvention, the non-image area of the output image is considered whitewhich will be used to fill around an image area being printed on adocument. However, it is noted that the non-image area of the outputdocument could be associated as non-printing area so as to not tointerfere with the color of the document. The blocks of image data forthe non-image areas of the output image are fed into multiplexer 33.

[0042] Multiplexer 33 selects between the image data being received fromthe FWA 11 or the image data for the non-image area received from thewhite field area generator 29. The selection by multiplexer 33 can berealized by a hardware multiplexing circuit or a software masking orsuppression routine done by a microprocessor. The multiplexer 33 makesits selection based on a control signal from the image area circuit 31.Image area circuit 31 receives the scanline signal and pixel clocksignal from the FWA 11. Also, the image area circuit 31 receives the setcoordinate values of VC₀, VC₁, and the center value of the inputdocument. From these values, the image area circuit determines the skewangle of the input document, calculates the position (coordinate valuesVC₂ and VC₃)of the third and fourth corners (C₂, C₃) of the inputdocument and determines the white field area of the output image. Thefunctions performed by the image area circuit 31 can be carried byhardware or in software by a microprocessor.

[0043] Thus, the image area circuit produces a select signal whichselects the data generated by the white field area generator 29 when theimage area circuit determines that that particular pixel in the outputimage corresponds to a non-image area. The data selected by themultiplexer 33 is stored in a memory 35 as a bitmap of the output imagefor later transmission, storage, or printing.

[0044] Although the determination of the various values above withrespect to corners and skew has been described with respect to specificcircuitry, in the preferred embodiment of the present invention, thesevalues are calculated in a processor 103 as illustrated in FIG. 6. Thearchitecture of FIG. 6 will be described below.

[0045]FIG. 6 illustrates a preferred embodiment of the electronicdocument registration system of the present invention. A sync circuit101 receives grey video data, a Insync signal and a pgsync signal froman image input terminal (IIT) (not shown). The IIT may be a digitalplaten scanner or a constant velocity transport digital scanner. Thesync circuit 101 generates a video signal, a valid video pixel signal, aInsync signal, and a pgsync signal which are fed to an edge detectcircuit 105. The lnsync and pgsync signals are also fed to a processor103.

[0046] The edge detect circuit 105 generates a video signal, a validsignal, a lnsync signal, and a pgsync signal which are fed to a windowgenerator 107. The window generator 107 generates an effptr (effectpointer) signal, a video signal, a valid signal, a lnsync signal, apsynw signal which are fed to a suppress and mask video circuit 109. Thesuppress and mask video circuit 109 generates a video signal which isfed to an image processing section for further image processing.

[0047] The system illustrated in FIG. 6 and discussed above operates asfollows:

[0048] Prior to the start of scanning, processor 103 programs the synccircuit 101 with a page length value (number of scan lines) and a linelength value (number of pixels) registers with values are apredetermined percentage larger than the input document image size. Inthe preferred embodiment, the predetermined percentage is 10%.

[0049] The IIT platen has a sensor which will assert the pgsync that isreceived by the sync circuit 101. The IIT will also mark the beginningof each scanline of video by asserting the Insync that is received bythe sync circuit 101. The pgsync and Insync signals are momentarysignals.

[0050] The sync circuit 101 will, in response to the pgsync and Insyncsignals from the IIT, assert a pgsync signal and a lnsync signal. Theduration of these lnsync and pgsync signals are determined by countersin the sync circuit 101 which count up to the values stored in pagelength and line length registers. These values are the values programmedinto the sync circuit 101, prior to scanning, by the processor 103.

[0051] Processor 103 maintains a count of the sync circuit's lnsyncsignal after the assertion of pgsync by the sync circuit 101. It isnoted that initially the pgsync signal from the sync circuit 101 is notgated through to the output of the edge detect circuit. Morespecifically, the psync signal generated by the edge detect circuit 105remains in a deasserted state until processor 103 locates the slow scanlead edge of the document.

[0052] Processor 103 locates the edges of the document in the videousing the edge position data and gray video of the center pixel providedby the edge detect circuit 105. The location of the center pixel isprogrammable in the edge detect circuit 105.

[0053] Edge detect circuit 105 measures the valid video pixel signalfrom the sync circuit 101 and detects for each scanline the first“black-to-white” transition pixel in the video as the fast scan startedge, and the last “white-to-black” transition pixel in the video as thefast scan end edge of the document. The pixel position of the two edgesare stored along with the gray video value of the center pixel.

[0054] Processor 103, responding to an interrupt generated by the edgedetect circuit 105 at the end of lnsync signal , reads the two edgepositions and the center pixel value from the edge detect circuit 105via a CPU bus. The processor 103 continues to acquire the edge positiondata from the edge detect circuit 105 until it has located the leadingedges of the document. Default registration is applied when theprocessor 103 is unable to locate the corners and/or the lead edge thedocument.

[0055] Once processor 103 has located the slow scan lead edge of thedocument, the edge detect circuit 105 is programmed by processor 103 togate through the pgsync signal to the psync output. The assertion of thepsync signal by the edge detect circuit 105 marks the beginning of theimaged document and controls slow scan registration. Processor 103determines the slow scan trail edge of the document by extrapolatingfrom the located start edge and corners, the adjusted width of thesource document programmed prior to start of scan. The adjusted width isequal to the nominal width of the source document minus a tolerancevalue.

[0056] Once the psync signal has been asserted, a white masking windowis generated by the window generator 107 and applied by the suppress andmasking video circuit 109 to the slow scan lead edge of the detecteddocument image to serve as “edge fade-out” and to prevent black wedgesin the printed output if the document image is skewed. The processor 103then reprograms a new page length value in the sync circuit 101 toproperly terminate the pgsync signal. The sync circuit 101 will deassertpgsync when the page length counter reaches the new value stored in thepage length register.

[0057] Processor 103 also locates the fast scan start and end of thedocument. Processor 103 programs the window generator 107 to setupwindows to suppress the video outside the located fast scan documentimage area. Referring to the example illustrated in FIG. 1, processor103 programs the width and height of the three non-image windows and oneimage window and the effect pointers for each window. The effectpointers in the three non-image windows are programmed so the pixels inthese windows will be suppressed by the suppress and masking videocircuit 109. The effect pointer for the image window is programmed toapply the desired image processing effect to the pixels in this window.The location of the image window sets the fast scan registration of theimaged document.

[0058] It is noted that instead of reloading the sync circuit 101 with anew page length value to terminate pgsync, processor 103 may program anadditional window in the window generator 107 to deassert psyncw. Theheight of this window and the page length value stored in the synccircuit 101 are coordinated to terminate before the arrival of the nextpgsync form the IIT.

[0059] To reduce memory, the pixels outside the document image can besuppressed rather then masked. If the size of the document image locatedby the processor 103 is larger then the size programmed prior to startof scan, the difference is suppressed as well. If the document image isless then the size programmed prior to start of scan, additional windowsare created to mask the background video in addition to suppression tofill out the document imaged to the size programmed prior to start ofscan.

[0060] Further operations and principle of present invention will beexplained in more detailed utilizing the illustrations of FIGS. 1 and 2.As noted before, FIG. 1 shows a graphical representation illustratingthe overlaid relationship between the input document and the outputimage. It is noted that the skew illustrated in FIGS. 1 and 2 has beenexaggerated in order to show the concepts of the present invention in amore clear matter.

[0061] As illustrated in FIG. 1, the input document travels in thedirection of the arrow such that the leading edge of the input document1 will be the first edge read by the scanner. In the drawing, the actualphysical corners of the input document are denoted as C₀, C₁, C₂, andC₃. C₀ represents the first corner of the input document that will bedetected by the present invention. Moreover, C₁ represents the secondphysical corner of the document that will be detected by the presentinvention.

[0062] As the input document travels through a CVT scanner, the fullwidth array pixels read the background of the CVT scanner until theinput document actually is placed in the optical path between the lightsource and the full width array. The transition of the input documentinto the optical path causes the full width array to generate edge datawhich is detected by an edge detecting circuit.

[0063] If the input document is not skewed, a properly registered inputdocument will cause the full width array to generate a full scanline ofedge data. However, if the input document is skewed, the first corner ofthe input document transitioning into the optical path will create apartial scanline of edge data. As more of the input document ispositioned into the optical path, the edge data produced by the fullwidth array will migrate in the fast scan direction until the nextcorner of the input document is transitioned into the optical path.

[0064] As discussed above with respect to the present invention, thecenter pixel of the full width array is monitored to determine when thatpixel produces edge data. When the center cell produces edge data, thecenter value of the input document is determined. As illustrated in FIG.1, upon determining the center value of the input document, the boundaryof the first white field area is established. The first white field area4 is increased in area, scanline by scanline, until the presentinvention detects or establishes the coordinate value for VC₁. Thus, thewidth of the first white filed area is equal to the number of scanlinesbetween the center value and the established coordinate value C₁. Thelength of the first white field area 4 is the width of the documentwhich is established by the sensors in the document feeder apparatus.

[0065] Once the values VC₀ and VC₁ are established, the presentinvention is able to calculate the skew of the input document as well asthe coordinate values VC₂ and VC₃ of the corner C₂ and C₃, respectively,of the input document. In other words, the present invention is able toelectronically map out the position of the input document as ittransverses across the full width array. To produce a deskewed outputimage, the mapped input document is rotated by any conventional rotationmethod such that the corners C₀, C₁, C₂, and C₃ are transformed to newlycalculated output image corners illustrated by solid squares in FIG. 1.The deskewed output image is represented by the dotted line boundaryarea 2 of FIG. 1.

[0066] After the output image has been deskewed and properly mapped, theoutput image is filled in with the proper non-image areas and imageareas. More specifically, the deskewed output image includes the firstwhite field area 4, which is place in the output image. A second whitefield area 5 is generated to cover an area associated with the scanlinesbetween the coordinate values VC₁ and VC₃ (S_(C1) to S_(C3)) of cornersC₁ and C₃ and the pixels between the transformed corner corresponding toC₁ and the coordinate pixel value of VC₂. (CP_(C1) to P_(C2)) Lastly, athird white field area is generated to cover an area having a widthcorresponding to the number of scanlines between the coordinate valueVC₃ of corner C₃ and the transformed corner associated with C₃ (S_(C3)to CS_(C3)). The other dimension of this third white field areacorresponds to the pixel value of the transformed corner associated withC₂ and the pixel value of the coordinate value VC₀ of corner value C₀(CP_(C2) to P_(CO)).

[0067] By generating these three white field areas, the output image isbordered with non-image data so as to prevent black edges in the outputimage. The remaining area 3 of FIG. 1 is the image data area wherein theimage data from the input document associated with this area is placedinto the output image.

[0068] The image data from the input document, which is transferred tothe output image area, is bounded by a first corner having the cornervalue associated with the pixel value of the coordinate value VC₀ andthe scanline value of the coordinate value VC₁. The second corner ofthis bounded area has the coordinate value of the pixel value of thecoordinate value VC₂ value (P_(C2)) and the scanline value of thecoordinate value VC1 value (S_(C1)). A third corner of this boundedoutput image area has the pixel value of the coordinate value VC₂(P_(C2)) corner and the scanline value of the coordinate value VC₃(S_(C3)). The last corner of this bounded output image area has a pixelvalue of the coordinate value VC₀ value (P_(CO)) and a scanline value ofthe coordinate value VC₃ value (S_(C3)).

[0069]FIG. 2 illustrates a variation of the registration process ofFIG. 1. In this example, the areas 4′, 5′, 6′, 7, and 8 represent outputimage areas. More specifically, the white fill area generation method isadjusted to expand the output image area into the previously creatednon-image area. This process is realized by utilizing the skewinformation to more closely fit the image read from the input documentonto the output document.

[0070] It is also noted that the output image area 3 can be increased byreading the edge point along e₀ at the line where the center of theinput document is detected. This edge point e₀ would be utilized as thefast scan end rather than using the coordinate value VC₀. However, theuse of this technique depends on the accuracy of the edge data whichcannot be determined until the center of the document has been detected.

[0071] It is further noted that the electronic document registrationprocess described can be incorporated into a digital scanner or digitalcopier having two operating mode, copy-normal and copy-all. In thecopy-normal mode the edges of the document image are located within thevideo scanned by the IIT. A border of white-masking windows are appliedto prevent the black backup roll of a CVT from appearing on the printedoutput as black borders. The copy-all mode is provided when a userdesires a maximum amount of document image and will accept black borderson the printed output. In both modes a white-masking window is appliedat the lead edge to serve as “edge fade-out”.

[0072] There are three possible registration cases within thecopy-normal mode. The first case, which will be described briefly below,is when the original is of good quality, both fast scan and slow scanregistration are determined from the edges of the document.

[0073] In this situation, a processor locates the corners of thedocument, C₀ and C₁ as shown in FIGS. 1 and 2, and calculates the skewangle of the document. The processor then locates the slow scan leadedge of the document and asserts psync by executing an edge detectionalgorithm, which in the preferred embodiment of the present invention isa software routine, which detects the first slow scan “black-to-white”transition in the scanned video. Subsequently, a white-masking window isapplied at the slow scan lead edge of the document to prevent the blackbackup roll of the CVT from being imaged and to serve as “edgefade-out”.

[0074] Using the locations of the corners C₀ and C₁, the detected slowscan lead edge of the document and the calculated lead edge skew angle,the processor installs white-masking windows to prevent black wedgesfrom being imaged on the fast scan start and end edge and the slow scantrailing edge of the printed output. The processor also installssuppression windows outside of the white-masking windows to frame thedetected image for processing. Together the size and location of thesuppression windows and the white-masking windows determines the fastscan registration of the image.

[0075] The processor then programs the psync or psyncw to be deassertedto mark the end of the processed image. The number of lines in theprocessed image are predetermined based on the size of the originaldocument detected by side guides and a sensor in the input paper tray ofthe CVT.

[0076] The second case, which will be described briefly below, is whenthe condition of the original prevents the electronics from locating thecorners of the document with sufficiently high confidence (dog-earedcorners, teared or missing corners, . . . ) but still has a well definedlead edge, the document registration system uses the detected lead edgefor slow scan registration but applies a default fast scan registrationbased on the document length detected by the side guides in the CVT.

[0077] In this situation, if the processor cannot locate corner C₁, thefast scan length of the processed image is assigned a default valueequal to the size of the original document detected by the side guidesof the CVT input paper tray. The length is centered about the centerpixel location to enable the installation of the suppression and maskingwindows. The processor then locates the slow scan lead edge of thedocument image and asserts psync by executing the edge locatingalgorithm noted above which detects the first slow scan “black-to-white”transition in the scanned video. The slow scan size of the lead edgewhite-masking window in this mode is assigned a default value equal to aminimum of 13 scanlines after the detection of the document lead edge.The 13 scanlines is based on a maximum CVT skew of 3.75 mrads extendingover 11 inches of document length.

[0078] The processor then installs suppression windows and white-maskingwindows based on the located slow scan lead edge and defaulted fast scanstart and end for the document image. The processor programs the psyncor psyncw to be deasserted to mark the end of the processed image. Thenumber of scanlines in the processed image are predetermined based onthe size of the original document detected by the side guides and thesensor in the input paper tray of the CVT.

[0079] The third case, which will be described briefly below, is whenneither the corners nor the lead edge of the document are detected bythe electronics, defaults will be applied to both the slow scan and fastscan registration.

[0080] In this situation, the processor will assert psync if after apredetermined number of scanlines the slow scan lead edge of thedocument have yet to be located. The predetermined number of scanlinesis determined according to the concept of “dead reckoning” from theassertion of pgsync from the IIT. The installation of the lead edgewhite-masking windows and the fast scan suppression/masking windows isthe same as described above with respect to the second case.

[0081] As noted above, automatic document detection is intended tolocate “any rectangular piece” of document placed “anywhere” on theplaten. The present invention is directed to such a process wherein theprocess requires an initial prescan to locate edges (black->whitetransition followed by white->black transition). With the detection ofthe corners of the document with respect to the platen edges, a secondscan is performed to image the appropriate region (either the outerbounding box containing the entire document, or the largest possiblerectangular box that could be enclosed within the four corners to avoidany black borders). The document size obtained during prescan enablesthe machine to either setup reduction/enlargement parameters to fit ontoa preselected output paper or to select the appropriate output paper tofit 100% of the input image.

[0082] The present invention is directed to a method for detecting allthe four corners of a document placed on a platen. This method is suitedfor systems that do not have a windowing chip to blank outnon-rectangular regions. Unlike the process mentioned in U.S. Pat. No.5,528,387, there is no assumption made on the input size of the documentto determine the third and fourth corners (C₂, C₃) of the inputdocument. An automatic document detection or AutoFind process can bebroken into two distinctive blocks as seen in FIG. 7. The first block1000 involves hardware which looks for edges, either Black->White orWhite->Black transitions as described in U.S. Pat. No. 5,528,387. Thesecond block 1002 then analyzes the edge information to accuratelydetermine the four corners of the document. In the currentimplementation, a maximum of two edges can be detected in each scanlinescanned, a FSStart (Black->White transition) and a FSEnd (White->Blacktransition). Scanners with gray platen covers provide enough contrastbetween the cover and the document, but the ones with white platencovers require the platen cover to be open for detecting thetransitions. The steps involved in detecting the four corners of thedocument from the edge information is shown in the flowchart shown inFIG. 8. This flowchart represents the functionality carried out in thesecond block 1002 of FIG. 7.

[0083] As illustrated in FIG. 8, the corner values are initialized atstep S1001. Thereafter, at step S1002, the edges of the document aredetected and at step S1003 it is determined if the first corner has beendetected. If yes, the first corner coordinates are stored at step S1008.If it not determined that the first corner was detected, it isdetermined if the start or leading edge is less than a first thresholdat step S1004.

[0084] If it is determined that the start edge is less than a firstthreshold, it is determined if the edge is a valid corner at step S1005.If not a valid corner, the process returns to detecting edges. On theother hand, if it is a valid corner, step S1009 store the coordinates ofthe start edges.

[0085] If it is determined that the start edge is greater than a firstthreshold at step S1004 step S1006 determines if the end or trailingedge is greater than a second threshold. If it is determined that theend edge is greater than a second threshold, it is determined if theedge is a valid corner at step S1007. If not a valid corner, the processreturns to detecting edges. On the other hand, if it is a valid corner,step S1010 store the coordinates of the end edges.

[0086] In the preferred embodiment of the present invention, the edgeinformation from the edge detecting circuitry is obtained by averagingover a few pixels which eliminates picking up any noise in the data. Anadditional validity check is done to further ensure that the cornersfound are not due to some “dust” on the platen. A possible checkingcriteria for both the edges (StartEdge and EndEdge) is given below:

Edge_(i)=Edge_(i-j)±, jε[−2, 2]

[0087] δ is to compensate for skewed corners.

[0088] At the end of a prescan, the following information can beobtained:

[0089] The first corner detected (C_(0FS), C_(0SS)).

[0090] The minimum FSStart location (C_(1FS), C_(1SS)) and thecorresponding FSEnd (C_(1FS)).

[0091] The maximum FSEnd location (C_(2FS), C_(2SS)) and thecorresponding FSStart (C_(sFS)).

[0092] The last corner detected (C_(3FS), C_(3SS)).

[0093] Using these coordinates, the present invention programs thescanner to scan either a window that encloses the four corners of thedocument or a window that is enclosed within the four corners of thedocument, based on the user's preference {Black Border Erase (“BBE”)feature OFF/ON}. FIG. 9 shows an example of a skewed document placed onthe platen. One realizes that BBE OFF results in imaging the entireinput image at the expense of black borders around the edges, while BBEON eliminates the black borders resulting in loss of part of the image.Based on specific application, the user might choose one or the other.

[0094] To avoid jamming of paper while printing, typical xerographicengines require the edges of the output image to be white. Therefore, afew (X) millimeters of the output image are always blanked around theedges. So if BBE is ON, an additional test is performed to check if thedocument is skewed by more than X millimeters. The additional testinvolves analyzing the statistics of a few edges taken every ¼″ of thedocument. A “roughly straight” document (skewed less than X millimeters)would have all the points centered around the mean (μ) or in other wordsstandard deviation (σ) would be less than some value σ_(o). And if adocument is skewed and the standard deviation σ<σ_(o); the outerrectangular coordinates are used for scanning, and the regular Xmillimeters edge erase feature would delete the black borders around theedges. This ensures no extra loss of image when BBE is ON.

[0095] Once the appropriate coordinates are determined then the size ofthe output image can also be estimated as follows:

[0096] FS size=|C_(2FS)-C_(1FS)|, if BBE is OFF or FS skew<Xmillimeters. =|C_(1FS)-C_(2FS)|, if BBE is ON

[0097] SS size=|C_(3SS)-C_(0SS), if BBE is OFF or SS skew<X millimeters.=|C_(2SS)-C_(1SS), if BBE is ON

[0098] With the knowledge of FS and SS size, the appropriate paper traycan be selected to fit the entire image. But if a particular outputpaper is selected by the user, the scanned image could be automaticallyscaled with following ratios to fit the paper.

[0099] FS Ratio=(FS Output Paper Size)/(FS Size)

[0100] SS Ratio=(SS Output Paper Size)/(SS Size)

[0101] The present invention has been described in detail above;however, various modifications can be implemented without departing fromthe spirit of the present invention. For example, the preferredembodiment of the present invention has been described with respect to aCVT system; however, the present invention can be readily implementedwith a platen scanning system whether the document is being placed onthe platen manually or by a document handler.

[0102] Moreover, the various circuits illustrated in FIG. 6 may beimplemented on ASICs and the various calculations implemented insoftware.

[0103] In recapitulation, the present invention provides a flexibleelectronic registration system which provides registration of an inputdocument without requiring a mechanical device.

[0104] While the present invention has been described with reference tovarious embodiments disclosed herein before, it is not to be confined tothe detail set forth above, but is intended to cover such modificationsor changes as made within the scope of the attached claims.

What is Claimed is:
 1. A system for electronically registering an imageon an input document, comprising: scanning means for generating an imagedata stream representing an electronic image of the image on the inputdocument; edge detecting means, operatively connected to said scanningmeans, for detecting edge data within the image data stream; firstcorner detecting means, operatively connected to said edge detectingmeans, for detecting a first corner of a leading edge of the inputdocument based on the detected edge data and for establishing a firstcoordinate value therefrom; second corner detecting means, operativelyconnected to said edge detecting means, for detecting a second corner ofa leading edge of the input document based on the detected edge data andfor establishing a second coordinate value therefrom; edge rangedetermining means for determining a minimum and maximum location for aleading edge of the scanned document and for determining a minimum andmaximum location for a trailing edge of the scanned document; and windowmeans for generating an image window representing valid image data toprocessed and rendered based on said minimum and maximum location for aleading edge of the scanned document, said minimum and maximum locationfor a trailing edge of the scanned document, said first coordinatevalue, and said second coordinate value.
 2. The system as claimed inclaim 1 , wherein said first corner detecting means establishes thefirst coordinate value as being equal to the coordinate value of thedetected corner when the first corner is detected within a predeterminednumber of scanlines.
 3. The system as claimed in claim 1 , wherein saidfirst corner detecting means establishes the first coordinate value asbeing equal to the coordinate value of the detected corner when thefirst corner is detected within a predetermined pixels of a nominalcenter value.
 4. The system as claimed in claim 1 , wherein said windowmeans creates a scanning window which encloses all four corners of thedocument being scanned.
 5. The system as claimed in claim 1 , whereinsaid window means creates a scanning window which is within all fourcorners of the document being scanned.
 6. A method for electronicallyregistering an image on an input document, comprising the steps of: (a)generating an image data stream representing an electronic image of theimage on the input document; (b) detecting edge data within the imagedata stream; (c) detecting a first corner of a leading edge of the inputdocument based on the detected edge data and for establishing a firstcoordinate value therefrom; (d) detecting a second corner of a leadingedge of the input document based on the detected edge data and forestablishing a second coordinate value therefrom; (e) determining aminimum and maximum location for a leading edge of the scanned document;(f) determining a minimum and maximum location for a trailing edge ofthe scanned document; and (g) generating an image window representingvalid image data to processed and rendered based on the minimum andmaximum location for a leading edge of the scanned document, the minimumand maximum location for a trailing edge of the scanned document, thefirst coordinate value, and the second coordinate value.
 7. The methodas claimed in claim 6 , wherein said step (c) establishes the firstcoordinate value as being equal to the coordinate value of the detectedcorner when the first corner is detected within a predetermined numberof scanlines.
 8. The method as claimed in claim 6 , wherein said step(c) establishes the first coordinate value as being equal to thecoordinate value of the detected corner when the first corner isdetected within a predetermined pixels of a nominal center value.
 9. Themethod as claimed in claim 6 , wherein said step (g) creates a scanningwindow which encloses all four corners of the document being scanned.10. The method as claimed in claim 6 , wherein said step (g) creates ascanning window which is within all four corners of the document beingscanned.